import copy

class A:

    def __init__(self):
        self.x = 18
        self.msg = 'Hello'

class B(A):

    def __init__(self):
        super().__init__()
        self.y = 34

    def __str__(self):
        return '{}, {}, {}'.format(self.x, self.msg, self.y)

if __name__ == '__main__':
    b = B()
    c = copy.deepcopy(b)
    print([str(i) for i in (b, c)]) # 打印属性数据
    print([i for i in (b, c)]) # 打印实例地址
